package cn.tedu.boot07_1.controller;

import cn.tedu.boot07_1.entity.Product_1;
import cn.tedu.boot07_1.mapper.Product_1Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;
import java.util.List;

@RestController
public class Product_1Controller {
    @Autowired
    Product_1Mapper mapper;
    @RequestMapping("/insert")
    public void insert(@RequestBody Product_1 product_1) {
        mapper.insert(product_1);
    }
    @RequestMapping("/select")
    public List<Product_1> select() {
        return mapper.select();
    }
    @RequestMapping("delete")
    public void delete(int id) {
        mapper.deleteById(id);
    }
    @RequestMapping("/selectById")
    public Product_1 selectById(int id) {
        return mapper.selectById(id);
    }
    @RequestMapping("/update")
    public void update(@RequestBody Product_1 product_1) {
        mapper.update(product_1);
    }
}
